/*
 * @Description:
 * @Author: maskMan
 * @LastEditTime: 2024-06-12 11:21:46
 */
import request from '@/utils/request'

export const getUsers = (params: any) =>
  request({
    url: '/users',
    method: 'get',
    params: params
  })
export const createUser = (data: any) =>
  request({
    url: '/admin/createUser',
    method: 'get',
    params: data
  })
export const upUserStatus = (data: any) =>
  request({
    url: '/admin/upUserStatus',
    method: 'get',
    params: data
  })
export const getCounts = () =>
  request({
    url: 'admin/getCounts',
    method: 'get'
  })
export const delUser = (data: any) =>
  request({
    url: 'admin/delUser',
    method: 'get',
    params: data
  })
export const updateGame = (data: any) =>
  request({
    url: 'admin/updateGame',
    method: 'get',
    params: data
  })
export const createGame = (data: any) =>
  request({
    url: '/admin/createGame',
    method: 'get',
    params: data
  })
export const getUserInfo = (data: any) =>
  request({
    url: '/admin/getAdmin',
    method: 'post',
    data
  })

export const getUserByName = (username: string) =>
  request({
    url: `/users/${username}`,
    method: 'get'
  })

export const updateUser = (data: any) =>
  request({
    url: `/admin/updateUser`,
    method: 'get',
    params: data
  })
export const login = (data: any) =>
  request({
    url: 'admin/adminLogin',
    method: 'post',
    params: data
  })

export const logout = () =>
  request({
    url: '/admin/adminlogout',
    method: 'post'
  })

export const register = (data: any) =>
  request({
    url: '/users/register',
    method: 'post',
    data
  })
